package org.lane.riccochet.ui;

import java.awt.*;

import org.lane.riccochet.ui.screenmanager.*;

public class Riccochet {
	
	public static final long serialVersionUID = 1L;
	
	private ScreenManager screen;
	private Graphics2D page;
	private static final DisplayMode POSSIBLE_MODES[] = {
		new DisplayMode(800, 600, 32, 0),
		new DisplayMode(800, 600, 24, 0),
		new DisplayMode(800, 600, 16, 0),
		new DisplayMode(640, 480, 32, 0),
		new DisplayMode(640, 480, 24, 0),
		new DisplayMode(640, 480, 16, 0)
	};
	
	public Riccochet() {
		// Do nothing
	}
	
	public void run() throws NullPointerException {
		screen = new ScreenManager();
		
		try {
			DisplayMode displayMode = screen.findFirstCompatibleMode(POSSIBLE_MODES);
			screen.setFullScreen(displayMode);
			
			page = screen.getGraphics();
			page.drawOval(50, 50, 150, 30);
			
			screen.update();
				
			Thread.sleep(5000);
		} catch(InterruptedException ie) {
			// Absorb the exception
		} finally {
			screen.restoreScreen();
		}
	}
	
}
